package ch07_GUI编程;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

public class JSplitPaneDemo {
	public static void main(String[] args) {
		BaseFrame f =new BaseFrame("JSplitPane Demo");

		JSplitPane sp1=new JSplitPane();
		sp1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
		sp1.setOneTouchExpandable(true);
		sp1.setDividerLocation(100);
		sp1.setLocation(5,5);
		sp1.setSize(200, 125);

		JSplitPane sp2=new JSplitPane(JSplitPane.VERTICAL_SPLIT);
		JPanel p =new JPanel();
		p.add(new JButton("按钮一"));
		p.add(new JButton("按钮二"));
		sp2.setLeftComponent(p);
		sp2.setRightComponent(new JButton("按钮三"));
		sp2.setRightComponent(new JButton("按钮四"));
		sp1.setRightComponent(sp2);
		f.add(sp1);
		f.showMe();
		sp2.setDividerLocation(0.8);



	}
}
